import request from "@/utils/request"
// 注册
export function userRegister(userDTO){
    return request({
        method: "post",
        url: "/api/v1/user/register",
        data: {
            username: userDTO.username,
            pass: userDTO.pass,
            checkPass: userDTO.checkPass,
            email: userDTO.email,
        }
    })
}
// 登陆
export function userLogin(username,password){
    return request({
        method: "post",
        url: "/api/v1/user/login",
        data:{
            username,
            password,
        }
    })
}

//获取用户信息
export function userInfo(){
    return request({
        method: "get",
        url: "/api/v1/user/info"
    })
}

//退出登陆
export function userLogout(){
    return request({
        method: "get",
        url: "/api/v1/user/logout"
    })
}

//根据id查询某个用户信息
export function userInfoById(id){
    return request({
        method: "get",
        url : `/api/v1/user/userInfoById/${id}`
    })
}